package com.retail.bbq.cola.controller;


import com.retail.bbq.cola.annotation.EncryptResponse;
import com.retail.bbq.cola.service.ColaActivityParamService;
import com.retail.bbq.cola.vo.ResultVO;
import com.retail.bbq.cola.vo.request.ColaParamRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/cola-activity")
@Slf4j
public class ColaActivityController {

    @Resource
    private ColaActivityParamService colaActivityParamService;

    @EncryptResponse
    //@DecryptResponse
    @RequestMapping("/queryColaParam")
    public ResultVO<?> queryColaParam(@Validated @RequestBody ColaParamRequest request){
        return ResultVO.succ(colaActivityParamService.queryColaParam(request));
    }

    @RequestMapping("/addColaParam")
    public ResultVO<?> addColaParam(@Validated @RequestBody ColaParamRequest request){
        return ResultVO.succ(colaActivityParamService.addColaParam(request));
    }

}
